package com.center.xx1;

public class InServer implements Runnable{

	private Object data;
	private String type;
	private String queueName;
	private Centers centers;
	
	public InServer(Object data,String queueName,String type,Centers centers){
		this.data = data;
		this.queueName = queueName;
		this.type = type;
		this.centers = centers;
	}

	@Override
	public void run() {
		boolean flag = true;
		while(flag){
			try {
				centers.createOrGetQueue(queueName, type);
				centers.inQueue(queueName, type, data);
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}finally{
				flag = false;
			}
		}
		
	}
	
}
